<?php
require_once '../setting/system.php';
define('_STATIC_HTTP', _static());
@ini_set('session.save_path', '../var/tmp/admin');
@ini_set('error_log', '../var/log/' . strtolower($_SERVER['HTTP_HOST']) . '.log');
@ini_set('gd.jpeg_ignore_warning', 1);
$config['view']['template'] = 'admin';
$config['front']['base_controller'] = 'controller/admin';
$config['route'] = 'route/admin.php';
$config['front']['throw_exceptions'] = false;
$config['session']['db_handler'] = false;
require_once '../app/web.php';

function _static() {
	$static = '/static';
	$lang = include '../setting/language.php';
	preg_match('/([a-z0-9-]+\.[a-z]{2,10})$/is', strtolower($_SERVER['HTTP_HOST']), $host);
	$host = strtolower($host[1]);
	foreach($lang as $key => $v) {
		$pu = parse_url($v['http']);
		if(preg_match("#$host$#i", strtolower($pu['host']))) {
			$_cfg = $v['config'];
			$static = $_cfg['http']['static'];
			break;
		}
	}
	return $static;
}
